import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/home',
    component: () => import('@/views/MyHome.vue'),
    children: [
      { path: '/', redirect: '/article' },
      {
        path: '/article',
        component: () => import('@/views/layout/MyArticle.vue')
      },
      {
        path: '/classify',
        component: () => import('@/views/layout/MyClassify.vue')
      },
      {
        path: '/release',
        component: () => import('@/views/layout/MyRelease.vue')
      },
      {
        path: '/user',
        component: () => import('@/views/layout/MyUser.vue')
      }
    ]
  },
  { path: '/login', component: () => import('@/views/MyLogin.vue') }
]

const router = new VueRouter({
  routes
})

export default router
